<%@page import="org.apache.jasper.tagplugins.jstl.core.Import"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/inc/taglib.inc" %>
<%@ include file="/WEB-INF/inc/script.inc" %>
<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
	<base href="${base}">
    <title>中金通 | 编辑用户</title>

    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="font-awesome/css/font-awesome.css" rel="stylesheet">
	
	
	<!-- Data Tables -->
    <link href="css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">
    <link href="css/plugins/dataTables/dataTables.responsive.css" rel="stylesheet">
    <link href="css/plugins/dataTables/dataTables.tableTools.min.css" rel="stylesheet">
	<link href="css/plugins/datapicker/datepicker3.css" rel="stylesheet">
    <link href="css/animate.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">
	<link href="css/investor/jNotify.css" rel="stylesheet">
    <link href="css/plugins/datapicker/datepicker3.css" rel="stylesheet">

</head>

<body>

    <div id="wrapper">

    	<!-- 左侧菜单 -->
        <jsp:include page="/WEB-INF/jsp/common/main-menu.jsp"></jsp:include>

        <div id="page-wrapper" class="gray-bg">
        <div class="row border-bottom">
        <!-- 头部工具栏区 -->
        <jsp:include page="/WEB-INF/jsp/common/main-header.jsp"></jsp:include>
        </div>
            <div class="row wrapper border-bottom white-bg page-heading">
                <div class="col-lg-10">
                    <h2>客户管理</h2>
                    <ol class="breadcrumb">
                        <li>
                            <a href="common/platform">Home</a>
                        </li>
                        <li>
                            <a href="investor/list">投资人管理</a>
                        </li>
                        <li class="active">
                            <strong>修改投资人</strong>
                        </li>
                    </ol>
                </div>
                <div class="col-lg-2">

                </div>
            </div>
		
		<div class="row" style="margin-top:10px;">
			<div class="col-md-12">
                  <div class="tabs-container">
                      <ul class="nav nav-tabs">
                          <li>
						<a href="investor/list">
							 投资人列表
						</a>
					</li>
					<li >
						<a href="investor/add">
							 新增投资人
						</a>
					</li>
					<li>
						<a href="investor/group">
							 投资人组别
						</a>
					</li>
					<li class="active">
						<a >
							 修改投资人
						</a>
					</li>
                      </ul>
			      <div class="tab-content">
			         <div class="tab-pane active">
			             <div class="panel-body">
			               <div class="row">
			                <div class="col-md-12">
			                    <div class="ibox">
			                        <div><!-- class="ibox-content" -->
			                            <form method="post" id="editForm" enctype="multipart/form-data" action="investor/doAdd" class="form-horizontal">
									        <div class="hr-line-dashed"></div>
			                                <div class="form-group"><label class="col-sm-2 control-label">姓名</label>
			                                    <div class="col-sm-4">
			                                    	<input type="text" placeholder="姓名" name="name" value="${model.name}" class="form-control">
			                                    	<input type="text"style="display:none;" id="investor_id" name="id" value="${model.id}">
			                                    	<!-- <input type="text" style="display:none;" name="avatar" id="avatarUrl" value="">  -->
			                                    	<input type="text"style="display:none;" id="oldPath" name="oldPath" value="${model.avatar}">
			                                    </div>
			                                    <div style="width:700px;margin-left:50%;margin-top:-10px;position:absolute;">
			                                    	<label class="col-sm-2 control-label">头像上传</label><br/>
				                                    <dl class="clearFix" >
														<dd class="clear">
															<div id="flash">
										                        <p id="swf2">本组件需要安装Flash Player后才可使用，请从<a href="http://www.adobe.com/go/getflashplayer">这里</a>下载安装。</p>
															</div>
															<ul id="editorPanelButtons" class="clearFix" style="display:none;">
																	 <button type="button" id="upload" class="btn btn-outline btn-default">保存</button>
										               				 <button type="button" id="btn_canecl" class="btn btn-outline btn-default">取消</button>
															</ul>
														</dd>
													</dl>
									       		 </div>
			                                </div>
			                                <div class="hr-line-dashed"></div>
			                                <div class="form-group"><label class="col-sm-2 control-label">头像</label>
			                                    <div class="col-sm-4">
			                                    	<div id="name" class="detailText">
			                                    	 	<c:if test="${model.avatar == null}">
					                                    	<img style="border:1px solid #B7D4D7;width:100px;height:100px;" alt="头像" id="images" src= "${imagePrefix}investor/default.jpeg">
					                                    </c:if>
					                                    <c:if test="${model.avatar != null}">
					                                    	<img style="border:1px solid #B7D4D7;width:100px;height:100px;" alt="头像" id="images" src= "${imagePrefix}${model.avatar}">  
					                                    </c:if>
				                                    </div>
			                                    </div>
			                                </div>
			                                <div class="hr-line-dashed"></div>
			                                <div class="form-group"><label class="col-sm-2 control-label">联系电话</label>
			                                    <div class="col-sm-4"><input type="text" id="mobile" placeholder="联系电话" value="${model.mobile}" name="mobile" class="form-control"> <span class="help-block m-b-none">请输入您常用的手机号码或固定电话</span>
			                                    </div>
			                                </div>
			                                <div class="hr-line-dashed"></div>
			                                <div class="form-group"><label class="col-sm-2 control-label" for="datetimepicker">出生年月</label>
			                             	 <div class="col-sm-4">
					                            <div class="input-group date">
					                            	   <span class="input-group-addon"><i class="fa fa-calendar"></i></span><input id="datetimepicker" type="text" name="birthday" value="${model.birthdayString}" class="form-control" data-date-format="yyyy-mm-dd"  >
					                            </div>
						                    </div>
			                                </div>
			                                <div class="hr-line-dashed"></div>
			                                <div class="form-group"><label class="col-sm-2 control-label">邮箱</label>
			                                    <div class="col-sm-4"><input type="text" placeholder="邮箱" name="email" value="${model.email}" class="form-control"></div>
			                                </div>
			                                <div class="hr-line-dashed"></div>
			                                <div class="form-group"><label class="col-lg-2 control-label">证件类型</label>
			                                    <div class="col-sm-4"> 
				                                    <select  class="form-control" name="idType"id="idType">  
					                                    <c:if test="${model.idType == '护照'}">
					                                    	<option  value="身份证">身份证</option>
									                        <option  value="护照" selected>护照</option> 
									                        <option  value="军官证">军官证</option> 
									                        <option  value="港澳回归证">港澳通行证</option> 
									                        <option  value="台胞证">台胞证</option>  
					                                    </c:if>
									                    <c:if test="${model.idType == '身份证'}">
					                                    	<option  value="身份证" selected>身份证</option>
									                        <option  value="护照">护照</option> 
									                        <option  value="军官证">军官证</option> 
									                        <option  value="港澳回归证">港澳通行证</option> 
									                        <option  value="台胞证">台胞证</option>  
					                                    </c:if>
					                                    <c:if test="${model.idType == '港澳回归证'}">
					                                    	<option  value="身份证">身份证</option>
									                        <option  value="护照">护照</option> 
									                        <option  value="军官证">军官证</option> 
									                        <option  value="港澳回归证" selected>港澳通行证</option> 
									                        <option  value="台胞证">台胞证</option> 
					                                    </c:if> 
					                                    <c:if test="${model.idType == '台胞证'}">
					                                    	<option  value="身份证">身份证</option>
									                        <option  value="护照">护照</option> 
									                        <option  value="军官证">军官证</option> 
									                        <option  value="港澳回归证">港澳通行证</option> 
									                        <option  value="台胞证" selected>台胞证</option>  
					                                    </c:if> 
					                                    <c:if test="${model.idType == '军官证'}">
					                                    	<option  value="身份证">身份证</option>
									                        <option  value="护照">护照</option> 
									                        <option  value="军官证" selected>军官证</option> 
									                        <option  value="港澳回归证">港澳通行证</option> 
									                        <option  value="台胞证">台胞证</option>  
					                                    </c:if>   
					                                    <c:if test="${model.idType == null ||model.idType == ''}">
									                        <option  value="身份证" selected>身份证</option>
									                        <option  value="护照">护照</option> 
									                        <option  value="军官证">军官证</option> 
									                        <option  value="港澳回归证">港澳通行证</option> 
									                        <option  value="台胞证">台胞证</option>  
					                                    </c:if>   
								                    </select>   
							                    </div>
			                                </div>
			                                <div class="hr-line-dashed"></div>
			                                <div class="form-group"><label class="col-lg-2 control-label">证件号</label>
			                                    <div class="col-sm-4"><input type="text" id="idcard_val" placeholder="证件号" value="${model.idcard}" name="idcard" class="form-control"></div>
			                                </div>
			                                <div class="hr-line-dashed"></div>
			                                <div class="form-group"><label class="col-sm-2 control-label"><br/>
			                                    <small class="text-navy">请选择性别</small></label>
			                                    <div class="col-sm-8">
			                                    	<c:if test="${model.gender == '1'}">
				                                    	<div><br/><label> <input type="radio" checked value="1" id="optionsRadios1" name="gender"> 男</label></div>
				                                        <div><label> <input type="radio" value="2" id="optionsRadios2" name="gender"> 女</label></div>
			                                    	</c:if>
			                                    	<c:if test="${model.gender == '2'}">
			                                    		<div><br/><label> <input type="radio"  value="1" id="optionsRadios1" name="gender"> 男</label></div>
			                                        	<div><label> <input type="radio" checked value="2" id="optionsRadios2" name="gender"> 女</label></div>
			                                    	</c:if>
			                                    	<c:if test="${model.gender == null}">
			                                    		<div><br/><label> <input type="radio"  value="1" id="optionsRadios1" name="gender"> 男</label></div>
			                                        	<div><label> <input type="radio"  value="2" id="optionsRadios2" name="gender"> 女</label></div>
			                                    	</c:if>
			                                    </div>
			                                </div>
			                                <div class="hr-line-dashed"></div>
			                                <div class="form-group"><label class="col-lg-2 control-label">公司</label>
			                                    <div class="col-lg-4"><input type="text" name="company" value="${model.company}" class="form-control"></div>
			                                </div>
			                                <div class="form-group"><label class="col-lg-2 control-label">电话号码</label>
			                                    <div class="col-lg-4"><input type="text" name="telephone" value="${model.telephone}" class="form-control"></div>
			                                </div>
			                                <div class="hr-line-dashed"></div>
			                                
			                                 <div class="form-group">  
									                <label class="col-md-2 control-label">  
									                		    地址  
									                </label> 
									                <div class="col-md-3">  
									                    <select class="form-control" id="province" name="province">  
									                        <option value="">请选择省份</option>  
									                    </select>  
									                </div>
									                <div class="col-md-3">      
									                    <select class="form-control" id="city" name="city">  
								                        	<option value="">请选择城市</option>  
									                    </select>  
									                </div>
									                <div class="col-md-3">        
									                    <select class="form-control" id="area" name="district">  
									                        <option value="">请选择区域</option>  
									                    </select>  
									                </div>  
									        </div>  
			                                <div class="form-group"><label class="col-sm-2 control-label">详细地址</label>
			                                   <div class="col-lg-4"><input type="text" name="address" value="${model.address}" class="form-control"></div>
			                                </div>
			                                <div class="hr-line-dashed"></div>
			                                <div class="form-group"><label class="col-sm-2 control-label"><br/><small class="text-navy">请选择组别</small></label>
												 <div class="col-lg-3"><select class="form-control" multiple="" id="selGroupId" name="groupId">
												 		<c:forEach items="${invesGroupList}" var="list2" varStatus="st">
															<option value="${list2.id}" name="${list2.name}"> ${list2.name}</option>
														</c:forEach>
			                                     </select></div>
			                                     <div class="col-sm-1">
				                                     <a class="btn btn-white btn-bitbucket" id="addStaff-add" onclick="add();"><i class="fa fa-mail-forward"></i></a><div><br/></div>
				                                     <a class="btn btn-white btn-bitbucket" id="addStaff-addAll" onclick="plu();"><i class="fa fa-mail-reply"></i></a>
			                                     </div>
			                                     <div class="col-lg-3"><select class="form-control" id="unselGroupId" multiple="">
			                                            <c:forEach items="${groupList}" var="list" varStatus="st">
															<option value="${list.id}" name="${list.name}"> ${list.name}</option>
														</c:forEach>
			                                     </select></div>
			                                     <button class="btn btn-primary"  type="button" id="add_group" data-toggle="modal" data-target="#myModal">新增组别</button>
			                                </div>
			                                <div class="hr-line-dashed"></div>
			                                <div class="form-group"><label class="col-sm-2 control-label">备注</label>
			                                    <div class="col-sm-4"><textarea type="text" style="resize:none;height:120px;" name="remark" class="form-control">${model.remark}</textarea></div>
			                                </div>
			                                <div class="hr-line-dashed"></div>
			                                <div class="form-group">
			                                    <div class="col-sm-4 col-sm-offset-2">
			                                        <!-- <button class="btn btn-white" type="reset">重置</button> -->
			                                        <button class="btn btn-primary" type="submit">保存</button>
			                                    </div>
			                                </div>
			                            </form>
			                        </div>
			                    </div>
			                </div>
			            </div>
			          </div>
			      </div>
			      
			  </div>
                  </div>
               </div>
		</div>
		
		<div class="modal inmodal" id="myModal" tabindex="-1" role="dialog" aria-hidden="true">
                <div class="modal-dialog">
                    <div class="modal-content animated fadeIn">
                        <div class="modal-header">
                            <h4 class="modal-title">新增组别</h4>
                    </div>	
                    <div class="modal-body">
                    	<div class="form-group"><label>组别名称</label> <input  type="text" id="group_name" placeholder="请输入组别名称" class="form-control"></input>
                    	<input type="text" style="display:none;" name="avatar" id="group_id" value=""> 
                    </div>
                    <div class="modal-footer">
                   		<div style="diasplay:none;" class="alert alert-danger display-hide" >
							组别名称长度为1到10个字符!
						</div>
                        <button type="button" class="btn btn-white" id="dsimiss_add_relation" data-dismiss="modal">取消</button>
                        <button type="button" id="btn_add_group_new" class="btn btn-primary">确定</button>
                    </div>
                </div>
            </div>
        </div>
        <!-- 底部版权 -->
        <jsp:include page="/WEB-INF/jsp/common/main-footer.jsp"></jsp:include>

        </div>
        </div>

    <!-- Mainly scripts -->
    <script src="js/jquery-2.1.1.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script>
    <script src="js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
	<script src="js/jquery.serialize-object.min.js" type="text/javascript"></script>
	<script src="js/plugins/validate/jquery.validate.min.js" type="text/javascript"></script>
	 <script src="js/plugins/datapicker/bootstrap-datepicker.js"></script>
    <!-- Custom and plugin javascript -->
    
    <script src="js/inspinia.js"></script>
    <script src="js/plugins/pace/pace.min.js"></script>
	<script src="js/plugins/bootbox/bootbox.min.js" type="text/javascript"></script>
    <!-- Data picker -->
   

    <!-- Data Tables -->
    <script src="js/plugins/dataTables/jquery.dataTables.min.js"></script>
    <script src="js/plugins/dataTables/dataTables.bootstrap.js"></script>
    <script src="js/plugins/dataTables/dataTables.responsive.js"></script>
    <script src="js/plugins/dataTables/dataTables.tableTools.min.js"></script>
    
    <!-- 业务 -->
    <script src="js/investor/swfobject.js"></script>
    <script src="js/investor/utils.js?v=${jsVersion}"></script>
    <script src="js/investor/fullAvatarEditor.js"></script>
    <script src="js/investor/edit.js?v=${jsVersion}"></script>
    <script src="js/investor/group.js?v=${jsVersion}"></script>
    <script src="js/investor/jNotify.js"></script>
    <!-- Page-Level Scripts -->
    <script>
    $(function(){
    	InvestorEdit.init();
        var p= '${model.province}';
    	var c= '${model.city}';
    	var a= '${model.district}';
   		load_province(p); //加载省份
   		load_city(p,c);//加载城市
    	load_area(c,a);//加载区域
    })
    $('#datetimepicker').datepicker({
                todayBtn: "linked",
                keyboardNavigation: false,
                forceParse: false,
                calendarWeeks: true,
                autoclose: true
    });
    </script>

</body>

</html>
